import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class FirstWindow extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public FirstWindow(){
		
		// Display Window Tittle
		super("Your computer has a virus");
		setSize(600,400); // Window Size
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		JPanel p = new JPanel();
		JPanel p2 = new JPanel();
		JPanel p3 = new JPanel(new GridBagLayout()); // work with gbc
		
		JButton b = new JButton("Button 1");
		JButton c = new JButton("Button 1");
		
		//make b do somthing
		b.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				JOptionPane.showMessageDialog(null, "good job");
			}
		});
		
		//Add Buttons to JPanel
		p.add(b);
		p.add(c);
		
		JCheckBox cb = new JCheckBox("Do you Love bacon?");
		JCheckBox cb2 = new JCheckBox("Do you Love cheese?");

		//Add Check Box to JPanel p2
		p2.add(cb);
		p2.add(cb2);
		
		JLabel label = new JLabel("This is a label");
		JTextArea tb = new JTextArea("this is a text area");
		JTextField textField = new JTextField("text field");
		
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.insets = new Insets(15,15,15,15);
		
		gbc.gridx = 0;// COLUMN
		gbc.gridy = 0;
		
		// Add stuff to JPanel p3
		p3.add(label,gbc);
		
		gbc.gridx = 0;
		gbc.gridy = 1;
		
		p3.add(tb,gbc);
		
		gbc.gridx = 0;
		gbc.gridy = 2;
		
		p3.add(textField,gbc);
		
		//Add Panel to JFrame
		add(p, BorderLayout.SOUTH);
		add(p2, BorderLayout.NORTH);
		add(p3, BorderLayout.CENTER);

	}
}
